package cn.cdeden.common.translation.core.impl;

import cn.cdeden.common.core.service.DictService;
import cn.cdeden.common.core.utils.StringUtils;
import cn.cdeden.common.oss.enumd.OssModuleType;
import cn.cdeden.common.translation.annotation.TranslationType;
import cn.cdeden.common.translation.constant.TransConstant;
import cn.cdeden.common.translation.core.TranslationInterface;
import lombok.AllArgsConstructor;

/**
 * @ProjectName : KnowCore
 * @Package : cn.cdeden.common.translation.core.impl
 * @ClassName : OssModuleTypeTranslationImpl
 * @Author : Yu.
 * @Description : // TODO
 * @Date : 2024/12/9 16:13
 * @Version : 1.0
 */
@AllArgsConstructor
@TranslationType(type = TransConstant.OSS_MODULE_TYPE_TO_NAME)
public class OssModuleTypeTranslationImpl implements TranslationInterface<String> {
    @Override
    public String translation(Object key, String other) {
        if (key instanceof String) {
            OssModuleType coedInfo = OssModuleType.findCoedInfo((String) key);
            return coedInfo !=null ? coedInfo.getName() : null;
        }
        return null;
    }
}
